<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>短链生成器 - 极简URL缩短服务</title>
    <meta name="description" content="极简的短链生成服务，快速将长链接转换为短链接">
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://cdn.bootcdn.net/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <style>
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
        }
        .gradient-bg {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }
        .glass-effect {
            background: rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.2);
        }
    </style>
</head>
<body class="min-h-screen gradient-bg flex items-center justify-center p-4">
    <div class="w-full max-w-md">
        <!-- 标题 -->
        <div class="text-center mb-8">
            <h1 class="text-4xl font-bold text-white mb-2">短链生成器</h1>
            <p class="text-white/80 text-lg">极简URL缩短服务</p>
        </div>

        <!-- 主卡片 -->
        <div class="glass-effect rounded-2xl p-6 shadow-2xl">
            <!-- 输入表单 -->
            <div class="space-y-4">
                <div>
                    <label class="block text-white/90 text-sm font-medium mb-2">
                        <i class="fas fa-link mr-2"></i>输入长链接
                    </label>
                    <input 
                        type="url" 
                        id="urlInput" 
                        placeholder="https://example.com/very-long-url-here"
                        class="w-full px-4 py-3 rounded-lg bg-white/10 border border-white/20 text-white placeholder-white/50 focus:outline-none focus:ring-2 focus:ring-white/50"
                    >
                </div>
                
                <div>
                    <label class="block text-white/90 text-sm font-medium mb-2">
                        <i class="fas fa-tag mr-2"></i>自定义短码（可选）
                    </label>
                    <input 
                        type="text" 
                        id="customCode" 
                        placeholder="例如：mylink"
                        maxlength="20"
                        class="w-full px-4 py-3 rounded-lg bg-white/10 border border-white/20 text-white placeholder-white/50 focus:outline-none focus:ring-2 focus:ring-white/50"
                    >
                </div>

                <button 
                    onclick="generateShortUrl()"
                    class="w-full bg-white/20 hover:bg-white/30 text-white font-semibold py-3 px-4 rounded-lg transition duration-200 flex items-center justify-center"
                >
                    <i class="fas fa-magic mr-2"></i>
                    <span id="generateBtnText">生成短链</span>
                </button>
            </div>

            <!-- 结果展示 -->
            <div id="result" class="hidden mt-6 p-4 bg-white/